//
//  MyStudyTableViewCell.m
//  Civacrm
//
//  Created by zhk on 2017/2/9.
//  Copyright © 2017年 王桂敏. All rights reserved.
//

#import "MyStudyTableViewCell.h"
#import "CircleProgressView.h"

@implementation MyStudyTableViewCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self setupView];
    }
    return self;
}


- (void)setupView
{
    CircleProgressView * progressView = [[CircleProgressView alloc]init];
    [self.contentView addSubview:progressView];
    progressView.currentValue = 0.5;
    progressView.totalValue = 1;
    progressView.backgroundColor = [UIColor clearColor];
    [progressView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.offset(20);
        make.top.offset(20);
        make.size.mas_offset(CGSizeMake(90, 90));
    }];
    
    self.titleLabel = [[UILabel alloc]init];
    [self.contentView addSubview:self.titleLabel];
    self.titleLabel.textColor = ColorWithHexString(@"4e778f");
    self.titleLabel.font = font(28);
    self.titleLabel.text = @"Civa智慧教育实训课程";
    [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(progressView.mas_right).offset(16);
        make.top.offset(34);
    }];
    
    self.detailLabel = [[UILabel alloc]init];
    [self.contentView addSubview:self.detailLabel];
    self.detailLabel.font = font(23);
    self.detailLabel.textColor = ColorWithHexString(@"a0c0d2");
    self.detailLabel.text = @"已完成32步 / 共198步";
    [self.detailLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.titleLabel);
        make.top.equalTo(self.titleLabel.mas_bottom).offset(12);
    }];
    
    self.moreBtn = [[UIButton alloc]init];
    [self.moreBtn setTitle:@"详情" forState:(UIControlStateNormal)];
    [self.moreBtn setTitleColor:[UIColor grayColor] forState:(UIControlStateNormal)];
    [self.contentView addSubview:self.moreBtn];
    [self.moreBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.titleLabel);
        make.top.equalTo(self.detailLabel.mas_bottom).offset(12);
    }];
    
    
    
}

@end
